home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / tbbs / prgsourc.zip / HOMES.ZIP / EDIT.PRG < prev    next >
Text File  |  1996-01-14  |  14KB  |  423 lines

  1. PROCEDURE edit
  2.  
  3. SET ORDER TO 2
  4.  
  5. DO WHILE .T.
  6.    ok = .F.
  7.    DO cls WITH 0,0,20,79
  8.    SET COLOR TO R/R                                    
  9.    @ 0,0 CLEAR TO 1,79                               
  10.    @ 21,0 CLEAR TO 23,79
  11.    SET COLOR TO GR+/R
  12.    @ 0,5 SAY "Real Estate Listings in " + city                 
  13.    @ 21,3 SAY "Enter letter to select"
  14.    @ 22,3 SAY "<Esc>"
  15.    SET COLOR TO W+/R
  16.    @ 1,5 SAY "Agent: " + hu
  17.    @ 0,73 SAY "EDIT  "
  18.    @ 1,73 SAY "SCREEN"
  19.    @ 22,9 SAY "= Quit Edit Screen"
  20.    DO escr
  21.    charin = " "
  22.    SET COLOR TO N/N
  23.    @ 2,0 GET charin
  24.    READ
  25.    DO CASE
  26.       CASE LastKey() = 27                        && <Esc>
  27.            EXIT
  28.       
  29.       CASE LastKey() = 68 .OR. LastKey() = 100   && 'D' or 'd': Delete
  30.            SET COLOR TO R/R
  31.            @ 21,3 CLEAR TO 22,30
  32.            DO gpic WITH 1
  33.            IF .NOT. ok
  34.               LOOP
  35.            ENDIF
  36.            DO cls WITH 2,0,20,79
  37.            DO vscr
  38.            DO view
  39.            DO BoxW WITH 9,20,12,49
  40.            @ 10,22 SAY "Are you sure that you want"
  41.            @ 11,22 SAY "to delete this listing?"
  42.            DO ty
  43.            SET COLOR TO N/N
  44.            @ 2,0 GET charin
  45.            DO WHILE .T.
  46.               READ
  47.               DO CASE
  48.                  CASE LastKey() = 89 .OR. LastKey() = 121   && `Y' or `y'
  49.                       REPLACE price WITH 0,size WITH 0,acres WITH 0,garage WITH .F.
  50.                       REPLACE heatpump WITH .F.,ac WITH .F.,basement WITH .F.
  51.                       REPLACE beds WITH 1, baths WITH .5
  52.                       DELETE
  53.                       DO cls WITH 2,0,20,79
  54.                       DO BoxW WITH 9,26,11,53
  55.                       @ 10,28 SAY "Listing has been deleted"
  56.                       key = InKey(3)
  57.                       EXIT
  58.                  CASE LastKey() = 78 .OR. LastKey() = 110   && 'N' or 'n'
  59.                       EXIT
  60.                  OTHERWISE
  61.                       LOOP
  62.               ENDCASE
  63.            ENDDO
  64.            LOOP
  65.            
  66.       CASE LastKey() = 78 .OR. LastKey() = 110   && 'N' or 'n': New
  67.            DO enew                               
  68.            IF .NOT. ok
  69.               LOOP
  70.            ENDIF
  71.            ok = .F.
  72.            REPLACE memo1 WITH "You have these three lines to enter any additional details about the home,"
  73.            REPLACE memo2 WITH "or financing information, or any other comments you would like to make."
  74.            REPLACE memo3 WITH "Each line is 75 characters wide, and will appear exactly as you enter it."
  75.            DO tf
  76.            REPLACE status WITH "Listed"
  77.            mp = .F.
  78.            DO uscr
  79.            REPLACE heat WITH ".........."
  80.            SET FORMAT TO fupd NOCLEAR
  81.            DO WHILE .T.
  82.               IF mp
  83.                  READ SELECT price
  84.               ELSE
  85.                  READ
  86.               ENDIF
  87.               DO CASE 
  88.                  CASE LastKey() = 3                         && <Page Dn>
  89.                       IF price < 3000
  90.                          DO BoxW WITH 8,28,10,50
  91.                          @ 9,30 SAY "Price is incorrect."
  92.                          key = InKey(3)
  93.                          mp = .T.
  94.                          DO uscr
  95.                          LOOP
  96.                       ENDIF
  97.                       IF status = "Listed " .OR. status = "Sold   " .OR. status = "Model  " .OR. status = "Pending" 
  98.                          ok = .F.
  99.                       ELSE   
  100.                          DO BoxW WITH 8,26,10,52
  101.                          @ 9,28 SAY "Status field incorrect."
  102.                          key = InKey(3)
  103.                          DO uscr
  104.                          LOOP
  105.                       ENDIF
  106.                       EXIT
  107.                  OTHERWISE
  108.                       LOOP
  109.               ENDCASE
  110.            ENDDO
  111.            RELEASE mp
  112.            SET FORMAT TO fscr NOCLEAR
  113.            DO cls WITH 2,0,20,79
  114.            SET COLOR TO GR+/R
  115.            @ 21,3 CLEAR TO 23,79
  116.            @ 21,3 SAY "<Esc>" 
  117.            SET COLOR TO W+/R
  118.            @ 21,9 SAY "= Quit View Screen, return to Edit Screen"
  119.            DO vscr
  120.            DO view
  121.            DO BoxW WITH 7,16,10,55
  122.            @ 8,18 SAY "The listing has been saved. This is"
  123.            @ 9,18 SAY "how it will appear when viewed."
  124.            key = InKey(4)
  125.            DO cls WITH 7,16,10,55
  126.            SET COLOR TO  W+/N
  127.            @ 7,16 SAY ":"
  128.            @ 7,16 SAY ":"
  129.            @ 7,45 SAY "Garage:"
  130.            @ 8,16 SAY "s:"
  131.            @ 8,45 SAY "Basement:"
  132.            @ 9,16 SAY "e:"
  133.            @ 9,45 SAY "Central Air:"
  134.            SET COLOR TO BG/N
  135.            @ 7,18 SAY beds PICTURE "@B 9"
  136.            IF garage
  137.               @ 7,53 SAY "Yes "
  138.            ELSE
  139.               @ 7,53 SAY "Non"
  140.            ENDIF
  141.            @ 8,19 SAY baths PICTURE "@Z 9"
  142.            IF IsInt(baths)
  143.               @ 8,Col()+1 SAY "   "     
  144.            ELSE
  145.               @ 8,Col()+1 SAY "1/2"
  146.            ENDIF
  147.            IF basement
  148.               @ 8,55 SAY "Y"
  149.            ELSE
  150.               @ 8,55 SAY "N"
  151.            ENDIF
  152.            IF heatpump
  153.               @ 9,19 SAY "Heat Pump "
  154.               SET COLOR TO W+/N
  155.               @ 10,8 SAY "Backup Heat:"
  156.               SET COLOR TO BG/N
  157.               @ 10,21 SAY heat
  158.            ELSE
  159.               @ 9,19 SAY heat
  160.            ENDIF
  161.            IF fireplace # 0
  162.               SET COLOR TO W+/N
  163.               @ 10,45 SAY "Fireplaces:"
  164.            ENDIF
  165.            DO WHILE LastKey() # 27                         && <Esc>
  166.               READ
  167.            ENDDO
  168.            LOOP
  169.       
  170.       CASE LastKey() = 80 .OR. LastKey() = 112   && 'P' or 'p': Add Picture       
  171.            Do cls WITH 2,0,20,79
  172.            DO BoxW WITH 6,13,16,66
  173.            @ 7,15 SAY  "This selection is used to upload a picture that"
  174.            @ 8,15 SAY  "has been scanned as a computer image. The image"
  175.            @ 9,15 SAY  "must be in GIF format. The file may have any name,"
  176.            @ 10,15 SAY "as it will be renamed upon upload. Up to four" 
  177.            @ 11,15 SAY "pictures may be uploaded: an exterior picture, a"
  178.            @ 12,15 SAY "map of the property, a floor plan, and an interior"
  179.            @ 13,15 SAY "picture."
  180.            SET COLOR TO W+/W
  181.            @ 15,23 SAY         "───── Any Key to Continue ─────"
  182.            key = Inkey(40)
  183.            Do cls WITH 2,0,20,79
  184.            DO BoxW WITH 6,12,15,67
  185.            @ 7,14 SAY "If you do not have access to a scanner, many photo"
  186.            @ 8,14 SAY "stores will scan photos cheaply. You can also mail"
  187.            @ 9,14 SAY "the picture to this BBS, and the picture or map"
  188.            @ 10,14 SAY "(up to 8½ x 11) will be scanned for you. There is"
  189.            @ 11,14 SAY "a charge of $5.00. Please write the reference number"
  190.            @ 12,14 SAY "on the back, and the name of the listing agent."
  191.            SET COLOR TO W+/W
  192.            @ 14,22 SAY          "───── Any Key to Continue ─────"
  193.            key = Inkey(40)
  194.            Do cls WITH 2,0,20,79
  195.            DO BoxW WITH 8,19,10,60
  196.            @ 9,21 SAY "Do you have a picture ready to upload?"
  197.            DO ty
  198.            ok = .T.
  199.            SET COLOR TO N/N
  200.            @ 2,0 GET charin
  201.            DO WHILE .T.
  202.               READ
  203.               DO CASE 
  204.                  CASE LastKey() = 89 .OR. Lastkey() = 121    && Y or y: yes
  205.                       EXIT
  206.                  CASE LastKey() = 78 .OR. Lastkey() = 110    && N or n: No
  207.                       ok = .F.
  208.                       EXIT
  209.                  OTHERWISE
  210.                       LOOP
  211.               ENDCASE
  212.            ENDDO
  213.            IF .NOT. ok
  214.               LOOP
  215.            ENDIF
  216.            SET COLOR TO R/R
  217.            @ 21,3 CLEAR TO 22,30
  218.            DO gpic WITH 2
  219.            IF .NOT. ok
  220.               LOOP
  221.            ENDIF
  222.            SET COLOR TO GR+/R
  223.            @ 21,3 SAY "Enter letter to select"
  224.            @ 22,3 SAY "<Esc>"
  225.            SET COLOR TO W+/R
  226.            @ 22,9 SAY "= Quit Upload"
  227.            DO cls WITH 2,0,20,79
  228.            DO pscr
  229.            SET COLOR TO N/N
  230.            @ 2,0 GET charin
  231.            DO WHILE .T.
  232.               READ
  233.               DO CASE
  234.                  CASE LastKey() = 27                        && <Esc>
  235.                       EXIT
  236.                  CASE LastKey() = 80 .OR. LastKey() = 112   && P or p:Picture
  237.                       REPLACE pic WITH .T.
  238.                       DO cls WITH 0,0,23,79
  239.                       DO BoxW WITH 2,28,5,77
  240.                       @ 3,30 SAY "You will need to send the file using your file"
  241.                       @ 4,30 SAY "name when prompted by, Ready to receive.."
  242.                       key = InKey(3)
  243.                       SET COLOR TO W+/N
  244.                       DOTBBS TYPE 30 OPTDATA "C:\HOMEBASE\PICS\" + homes + pic1 + "PIC.GIF /F/D"
  245.                       QUIT
  246.                  CASE LastKey() = 77 .OR. LastKey() = 109   && M or m:Map
  247.                       REPLACE map WITH .T.
  248.                       DOTBBS TYPE 30 OPTDATA "C:\HOMEBASE\PICS\" + homes + pic1 + "MAP.GIF /F/D"
  249.                       QUIT
  250.                  CASE LastKey() = 70 .OR. LastKey() = 102   && F or f:Floor Plan
  251.                       REPLACE pln WITH .T.
  252.                       DOTBBS TYPE 30 OPTDATA "C:\HOMEBASE\PICS\" + homes + pic1 + "PLN.GIF /F/D"
  253.                       QUIT
  254.                  CASE LastKey() = 73 .OR. LastKey() = 105   && I or i:Interior
  255.                       REPLACE int WITH .T.
  256.                       DOTBBS TYPE 30 OPTDATA "C:\HOMEBASE\PICS\" + homes + pic1 + "INT.GIF /F/D"
  257.                       QUIT
  258.                  OTHERWISE
  259.                       LOOP
  260.               ENDCASE
  261.            ENDDO
  262.            LOOP
  263.  
  264.       CASE LastKey() = 85 .OR. LastKey() = 117   && 'U' or 'u': Update
  265.            SET COLOR TO R/R
  266.            @ 21,3 CLEAR TO 22,30
  267.            DO gpic WITH 2
  268.            IF .NOT. ok
  269.               LOOP
  270.            ENDIF
  271.            DO tf
  272.            DO uscr
  273.            mp = .F.
  274.            SET FORMAT TO fupd NOCLEAR
  275.            DO WHILE .T.
  276.               IF mp
  277.                  READ SELECT price
  278.               ELSE
  279.                  READ
  280.               ENDIF
  281.               DO CASE 
  282.                  CASE LastKey() = 3                         && <Page Dn>
  283.                       IF price < 5000
  284.                          DO BoxW WITH 8,28,10,50
  285.                          @ 9,30 SAY "Price is incorrect."
  286.                          mp = .T.
  287.                          DO uscr
  288.                          LOOP
  289.                       ENDIF
  290.                       IF status = "Listed" .OR. status = "Sold" .OR. status = "Model" .OR. status = "Pending" 
  291.                          ok = .F.
  292.                       ELSE
  293.                          DO BoxW WITH 8,26,10,52
  294.                          @ 9,28 SAY "Status field incorrect."
  295.                          DO uscr
  296.                          LOOP
  297.                       ENDIF
  298.                       EXIT
  299.                  OTHERWISE
  300.                       LOOP
  301.               ENDCASE
  302.            ENDDO
  303.            RELEASE mp
  304.            SET FORMAT TO fscr NOCLEAR
  305.            LOOP
  306.       
  307.       CASE LastKey() = 86 .OR. LastKey() = 118   && 'V' or 'v': View listings       
  308.            IF own 
  309.               DO cls WITH 2,0,20,79
  310.               SET COLOR TO GR+/R
  311.               @ 22,1 CLEAR TO 22,50
  312.               DO BoxW WITH 7,6,10,28
  313.               @ 8,10 SAY "] Agency Listings"   
  314.               @ 9,10 SAY "] Broker Listings"   
  315.               SET COLOR TO W+/W 
  316.               @ 8,8 SAY "["
  317.               @ 9,8 SAY "["
  318.               SET COLOR TO GR+/W 
  319.               @ 8,9 SAY "A"
  320.               @ 9,9 SAY "B"
  321.               ok = .T.
  322.               SET COLOR TO N/N
  323.               @ 2,0 GET charin
  324.               DO WHILE .T.
  325.                  READ
  326.                  DO CASE
  327.                     CASE LastKey() = 65 .OR. LastKey() = 97   && 'A' or 'a'
  328.                          DO atag
  329.                          SELECT a
  330.                          DO lview
  331.                          SET ORDER TO 2
  332.                          ok = .F.
  333.                          EXIT
  334.  
  335.                     CASE LastKey() = 66 .OR. LastKey() = 98   && 'B' or 'b'
  336.                          brok = " "
  337.                          DO BoxW WITH 7,6,10,33
  338.                          @ 8,8 SAY "Select the listing agent"
  339.                          @ 9,8 SAY "from the pick list"
  340.                          DO pagnt
  341.                          EXIT
  342.                     OTHERWISE 
  343.                          LOOP
  344.                 ENDCASE
  345.               ENDDO
  346.               IF .NOT. ok
  347.                  LOOP
  348.               ENDIF
  349.            ELSE
  350.              brok = agnte
  351.            ENDIF
  352.            DO etag
  353.            DO lview
  354.            SET ORDER TO 2
  355.            LOOP
  356.       
  357.       OTHERWISE
  358.            LOOP
  359.    
  360.    ENDCASE
  361. ENDDO
  362. RETURN
  363.  
  364.  
  365.  
  366.  
  367. PROCEDURE gpic
  368. PARAMETERS ch
  369.  
  370. pc = "..."
  371. DO cls WITH 2,0,20,79     
  372. DO BoxW WITH 8,20,11,52
  373. @ 9,22 SAY "Enter the reference number of"
  374. IF ch = 1        
  375.         @ 10,22 SAY "the listing to delete:"
  376. ELSE                                               && ch = 2
  377.         @ 10,22 SAY "the listing to update:"
  378. ENDIF
  379. SET COLOR TO W+/W
  380. @ 10,45 GET pc PICTURE "@K "
  381. READ
  382. SEEK pc
  383. IF .NOT. Found()
  384.    DO BoxB WITH 5,40,7,77
  385.    @ 6,42 SAY "Reference number" 
  386.    @ 6,63 SAY "was not found" 
  387.    SET COLOR TO GR+/B
  388.    @ 6,59 SAY pc
  389.    key = Inkey(5)
  390.    ok = .F.
  391.    RETURN
  392. ENDIF
  393. IF uPriv() = 255
  394.    ok = .T.
  395.    RETURN
  396. ENDIF
  397. IF own
  398.    SELECT c
  399.    SEEK a->broker
  400.    IF comp # agency 
  401.       DO BoxB WITH 4,40,7,77      
  402.       @ 5,44 SAY "Not your listing. You are not"
  403.       @ 6,42 SAY "authorized to modify or delete it."
  404.       key = InKey(5)
  405.       SELECT a
  406.       ok = .F.
  407.       RETURN
  408.    ENDIF
  409.    SELECT a
  410. ELSE
  411.    IF agnte # broker
  412.       DO BoxB WITH 4,40,7,77      
  413.       @ 5,44 SAY "Not your listing. You are not"
  414.       @ 6,42 SAY "authorized to modify or delete it."
  415.       key = InKey(5)
  416.       ok = .F.
  417.       RETURN
  418.    ENDIF
  419. ENDIF
  420. ok = .T.
  421. RETURN
  422.  
  423.